#include<iostream>
using namespace std;
void draw(int n, int m){
    cout<<"+";
    for(int i=0;i<n;i++){
        cout<<"-";
    }
    cout<<"+"<<endl;
    for(int i=0;i<m;i++){
        cout<<"|";
        for(int j=0;j<n;j++){
            cout<<" ";
        }
        cout<<"|"<<endl;
    }
    cout<<"+";
    for(int i=0;i<n;i++){
        cout<<"-";
    }
    cout<<"+"<<endl<<endl;
}
int main(){
    int width,height;
    while(cin>>width>>height&&width>0&&width<75&&height>0&&height<75){
        draw(width,height);
    }
}